<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="apple-mobile-web-app-status-bar-style" content="black">
  <meta name="apple-mobile-web-app-title" content="">
  <meta name="format-detection" content="telephone=no">
  <meta name="full-screen" content="yes">
  <meta name="x5-page-mode" content="app">
  <meta name="x5-fullscreen" content="true">
  <meta name="browsermode" content="application">
  <meta content="" name="keywords">
  <meta content="" name="description">
  <link rel="stylesheet" href="https://cdn.bootcss.com/weui/1.1.3/style/weui.min.css">
  <link rel="stylesheet" href="https://cdn.bootcss.com/jquery-weui/1.2.1/css/jquery-weui.min.css">
  <link rel="stylesheet" href="./js/layer_mobile/need/layer.css">
  <link rel="stylesheet" href="./css/style.css">
  <link rel="stylesheet" href="./js/dropload/dropload.css">
  <title>收入明细</title>
  <style>
  .content { text-align: center; }
  .content img { max-width: 200px; }
  .warning { color: #f76260; }
  .weui-form-preview__value small { font-size: 60%; }
  </style>

  <body>
    <div class="page__hd">
      <div class="page__title">收入明细</div>
      <div class="page__desc">凭本事挣来的钱</div>
    </div>

    <script id='wrap' type='text/html'>
      <div class="content">
        {{# 
          for(var i=0; i<d.length; i++) {
            var item = d[i];
        }}
        <div class="weui-form-preview mb20">
          <div class="weui-form-preview__hd">
            <label class="weui-form-preview__label">
              {{# if(item.type == 1) { }}
              发布活动
              {{# } else if(item.type == 2) { }}
              充值红包
              {{# } else if(item.type == 3) { }}
              升级VIP
              {{# } }}
            </label>
            <em class="weui-form-preview__value"><small>￥</small>{{ item.money }}</em>
          </div>
          <div class="weui-form-preview__bd">
            <div class="weui-form-preview__item">
              <label class="weui-form-preview__label">消费时间</label>
              <span class="weui-form-preview__value">{{ item.create_time }}</span>
            </div>
          </div>
          <!-- <div class="weui-form-preview__ft">
            <button type="submit" class="weui-form-preview__btn weui-form-preview__btn_primary" href="javascript:">支付成功</button>
          </div> -->
        </div>
        {{# } }}
      </div>
    </script>
    <div id="render"></div>

    <div class="dropload-down"><div class="dropload-refresh">↑上拉加载更多</div></div>
    
  </body>

  <script src="https://cdn.bootcss.com/jquery/2.1.1/jquery.min.js"></script>
  <script src="./js/dropload/dropload.min.js"></script>
  <script src="https://cdn.bootcss.com/vConsole/3.3.0/vconsole.min.js"></script>
  <script src="./js/tools2.js?ver=2.3"></script>
  <script src="./js/jweixin-1.4.0.js?ver=1.0"></script>
  <script src="./js/layer_mobile/layer.js"></script>
  <script src="./js/layer_mobile/laytpl.js"></script>
  <script>
    // var vConsole = new VConsole();
    var contents = [];
    var page = 0;
    var wrap = $('#wrap').html();
    var pid = tools.getQueryString('pid');
    
    if(!!pid) {
      tools.login(function() {
        $('.content').dropload({
          scrollArea : window,
          loadDownFn: function(me) {
            page++;
            tools.ajax({
              url: '/proxy/revenue/' + pid,
              data: { page: page },
              success: function(res) {
                if(res.code == 0 && res.data.data && res.data.data.length > 0) {
                  contents = contents.concat(res.data.data);
                } else {
                  me.lock();
                  me.noData();
                }
                laytpl(wrap).render(contents, function(html) {
                  $('#render').html(html);
                  me.resetload();
                })
              },
              error: function(err) {
                // me.resetload();
                me.lock();
                me.noData();
                if(err.status === 403) {
                  tools.wxLogin();
                } else {
                  layer.open({ content: '网络连接出错', skin: 'msg', time: 2 });
                }
              }
            })
          }
        })
      })
    }

    tools.hide();
  </script>
</body>
</html>